package com.mzy.datepackage.M2022.Jun.TenThree;

import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/6/13 10:27
 * @Version 1.0
 */
public class TestObject {
    public static void main(String[] args) {
        object object = new object();
        object.setName("测试1");
        ArrayList<Teacher> teachers = new ArrayList<>();
        teachers.add(new Teacher("小黄",25));
        teachers.add(new Teacher("小李",29));
        object.setTeacher(teachers);

        List<Teacher> teacher = object.getTeacher();

//        teacher.add(new Teacher("小测",38));

        String jsonString = JSON.toJSONString(object,true);
        System.out.println(jsonString);
    }
}
